package com.itheima.web.controller;

import com.itheima.web.manager.MovementManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class MovementController {

    @Autowired
    private MovementManager movementManager;
    //动态通过
    @PostMapping("/manage/messages/pass")
    public ResponseEntity passMovement(@RequestBody String[] item){
        //调用manager通过
        return movementManager.passMovement(item,1,"已审核");
    }

    //动态拒绝
    @PostMapping("/manage/messages/reject")
    public ResponseEntity rejectMovement(@RequestBody String[] item){
        //调用manager通过
        return movementManager.passMovement(item,2,"已驳回");
    }
}
